<script setup>
import {useRoleAll} from "@/composables/sys/role.js";

const props = defineProps({
  labelField: {
    type: String,
    default: 'name'
  },
  valueField: {
    type: String,
    default: 'id'
  }
})

defineEmits(['update:value'])

const {data, isLoading} = useRoleAll()

</script>

<template>
  <n-select
      filterable
      clearable
      placeholder="请选择"
      :loading="isLoading"
      :label-field="labelField"
      :value-field="valueField"
      @update:value="$emit('update:value', $event)"
      :options="data?.data"
      v-bind="$attrs"
  />
</template>

<style scoped>

</style>